package com.ai_daily.aitiantian.api;


import com.ai_daily.aitiantian.bean.BaseBean;
import com.ai_daily.aitiantian.bean.BaseResponseBean;
import com.ai_daily.aitiantian.bean.ChatStreamResponse;
import com.ai_daily.aitiantian.bean.CommonConfigResponseBean;
import com.ai_daily.aitiantian.bean.InitResponseBean;
import com.ai_daily.aitiantian.bean.QueryInfoResponseBean;
import com.ai_daily.aitiantian.bean.QueryVersionInfoResponseBean;
import com.ai_daily.aitiantian.bean.UpgradeResp;
import com.ai_daily.aitiantian.bean.param.ChatParam;
import com.ai_daily.aitiantian.bean.param.CloseChatParam;
import com.ai_daily.aitiantian.bean.param.CommonConfigParam;
import com.ai_daily.aitiantian.bean.param.DeviceInfoParam;
import com.ai_daily.aitiantian.bean.param.QueryInfoParam;
import com.ai_daily.aitiantian.bean.param.QueryKeywordParam;
import com.ai_daily.aitiantian.bean.param.QueryLogoParam;
import com.ai_daily.aitiantian.bean.param.QueryVersionInfoParam;

import java.util.List;

import okhttp3.MultipartBody;
import retrofit2.Call;
import retrofit2.http.Body;
import retrofit2.http.GET;
import retrofit2.http.Multipart;
import retrofit2.http.POST;
import retrofit2.http.Part;
import retrofit2.http.Query;
import retrofit2.http.Streaming;

public interface ApiService {
    // 版本检测
    @GET("api/user/checkUpdate")
    Call<UpgradeResp> checkUpdate();

    /** 激活设备 */
    @POST("aiChat/active")
    Call<BaseResponseBean> active(@Body DeviceInfoParam param);

    /** ai对话 */
//    @POST("aiChat/chat")
    @POST("aiChat/chat_v2")
    Call<BaseResponseBean> chat(@Body ChatParam param);

    @POST("aiChat/chat_v3")
    @Streaming
    Call<String> chat_v3(@Body ChatParam param);

    /** 初始化设备信息 */
    @POST("aiChat/init")
    Call<BaseResponseBean<InitResponseBean>> init(@Body DeviceInfoParam param);

    /** 查询通用配置 包含 到期提示文案，默认logo图片地址 */
    @POST("aiChat/queryCommonConfig")
    Call<BaseResponseBean<CommonConfigResponseBean>> queryCommonConfig(@Body CommonConfigParam param);

    /**查询设备信息 包含激活状态/设备状态/到期时间 */
    @POST("aiChat/queryInfo")
    Call<BaseResponseBean<QueryInfoResponseBean>> queryInfo(@Body QueryInfoParam param);

    /**根据设备信息查询logo */
    @POST("aiChat/queryLogo")
    Call<BaseResponseBean> queryLogo(@Body QueryLogoParam param);

    /**新版本检查 */
    @POST("aiChat/queryVersionInfo")
    Call<BaseResponseBean<QueryVersionInfoResponseBean>> queryVersionInfo(@Body QueryVersionInfoParam param);


    /**
     * 查询敏感词、休眠词
     * @param type 1 查询敏感词，2 查询休眠词
     * @return
     */
    @GET("/keywords/queryInfo")
    Call<BaseResponseBean<List<String>>> queryKeyword(@Query("type") int type);

    @Multipart
    @POST("/keywords/uploadImage")
    Call<BaseResponseBean> uploadImage(@Query("question") String question,
                                       @Query("keyword") String keyword,
                                       @Query("deviceId") String deviceId,
                                       @Part MultipartBody.Part image);

    /**通知对话关闭 */
    @POST("/aiChat/close_chat_v2")
    Call<BaseResponseBean> postCloseChat(@Body CloseChatParam param);

}
